import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JRadioButton;

import admin.AdminFrame;


public class Main extends JFrame implements ActionListener {
	
	private JButton butStart;
	private JRadioButton cosButton;
	private JRadioButton kioskButton;
	private JRadioButton workerButton;
	
	public Main() {
		butStart = new JButton("Start");
		cosButton = new JRadioButton("Costumer");
		kioskButton = new JRadioButton("Kiosk");
		workerButton = new JRadioButton("Worker");
		
		this.setSize(268, 214);
		this.getContentPane().setLayout(null);
		
		
	    cosButton.setMnemonic(KeyEvent.VK_B);
	    cosButton.setActionCommand("Costumer");
	    cosButton.setSelected(true);

	    kioskButton.setMnemonic(KeyEvent.VK_C);
	    kioskButton.setActionCommand("kiosk");
	    
	    workerButton.setMnemonic(KeyEvent.VK_C);
	    workerButton.setActionCommand("Worker");
	    
	    butStart.setBounds(63, 78, 100, 25);
	    
	    cosButton.setBounds(6, 20, 86, 25);	
	    kioskButton.setBounds(98, 20, 68, 25);
	    workerButton.setBounds(168, 20, 68, 25);
	    this.getContentPane().add(cosButton);
	    this.getContentPane().add(kioskButton);
	    this.getContentPane().add(workerButton);
	    this.getContentPane().add(butStart);
	    
	    ButtonGroup group = new ButtonGroup();
	    group.add(cosButton);
	    group.add(kioskButton);
	    group.add(workerButton);
	    
	    cosButton.addActionListener(this);
	    kioskButton.addActionListener(this);
	    workerButton.addActionListener(this);
	    butStart.addActionListener(this);
	    this.setVisible(true);
	    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
	    
	}
	
	public static void main(String args[])
	{ 
		new interfaceLogin.Login();
		//new AdminFrame();
	}
	

	
	@Override
	public void actionPerformed(ActionEvent e) {
		
		if(e.getSource() == butStart)
		{
			if(cosButton.isSelected())
			{
	    		new Interface.LoginGui();
	    		this.setVisible(false);
			}
			if(kioskButton.isSelected())
			{
	    		new Interface.KioskGui();
	    		this.setVisible(false);
			}
			if(workerButton.isSelected())
			{
				new interfaceWorker.WorkerFrame();
	    		this.setVisible(false);
			}
		}
	}
}
